package 多无人机架次;

import GA_Test.GAData;

import java.util.ArrayList;

public class Capcity {
    public static int Uzz(ArrayList<Integer> a) {

        int zz = 0;
        if (a.size() == 1) {//如果无人机路径里只有一个点  那么这个时候 返回的无人机载重值为0
            return 0;
        } else {
            for (int i = 1; i < a.size(); i++) {
                zz += GAData.cusInfo[a.get(i)].demand;
            }
            return zz;
        }
    }
    public static int truck_service(ArrayList<Integer> a) {

        int zz = 0;

            for (int i = 0; i < a.size(); i++) {
                zz += GAData.cusInfo[a.get(i)].demand;
            }
            return zz;
        }

    public static int drone_service(ArrayList<Integer> a) {

        int zz = 0;
        if (a.size() == 1) {//如果无人机路径里只有一个点  那么这个时候 返回的无人机载重值为0
            return 0;
        } else {
            for (int i = 1; i < a.size()-1; i++) {
                zz += GAData.cusInfo[a.get(i)].demand;
            }
            return zz;
        }
    }
    public static int fD(ArrayList<Integer> a) {

        int zz = 0;
        if (a.size() == 1) {//如果无人机路径里只有一个点  那么这个时候  无人机的续航为0
            return 0;
        } else {
            for (int i = 0; i < a.size(); i++) {
                zz += GAData.cusInfo[a.get(i)].demand;
            }
            return zz;
        }
    }
}
